package com.wanxi.dao.impl;

import com.wanxi.dao.LeaveDao;
import com.wanxi.dto.ResultDTO;
import com.wanxi.entity.LeaveEntity;
import com.wanxi.util.GetSqlSession;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : 林子淳
 * @create 2023/3/2 11:22
 */
public class LeaveDaoImpl implements LeaveDao<LeaveEntity> {
    @Override
    public List<LeaveEntity> findAll(LeaveEntity leave) {
        return GetSqlSession.getSqlSession().selectList("com.wanxi.dao.LeaveDao.findAll",leave);
    }

    @Override
    public int delete(LeaveEntity leaveEntity) {
        return GetSqlSession.getSqlSession().delete("com.wanxi.dao.LeaveDao.delete", leaveEntity);

    }

    @Override
    public int count() {
        return GetSqlSession.getSqlSession().selectOne("com.wanxi.dao.LeaveDao.count");

    }
}
